
package com.bdqn.controller;


import com.bdqn.pojo.Dept;
import com.bdqn.serivce.DeptClientService;
import com.bdqn.serivce.DeptClientServiceFallBackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class DeptConsumerController {


    @Autowired
    //@Resource(name = "deptClientService")
    private DeptClientService deptClientService;


    @RequestMapping("/consumer/add")
    public boolean add(@RequestBody Dept dept){
      return deptClientService.addDept(dept);
    }

    @RequestMapping("/consumer/get/{id}")
    public Dept get(@PathVariable Integer id){
     return deptClientService.queryById(id);

    }
    @RequestMapping("/consumer/list")
    public List<Dept> findAll(){
       return deptClientService.queryAll();
    }


}
